package codegen.graphnetwork.model;

import java.util.ArrayList;

/**
 *
 * @author hungcuong
 */
public class Node {

    String name;
    int x, y;
    Status status;
    ArrayList<Value> inputs = new ArrayList<Value>();
    ArrayList<Value> outputs = new ArrayList<Value>();

    enum Status {

        Init, Computing, Finished
    }

    public Node(String name) {
        this.name = name;
        this.status = Status.Init;
        //this.operation = new OpAdd(this);

    }

    public void addInput(Value value) {
        inputs.add(value);
        value.parent = this;
        value.isInput = true;
    }

    public void addOutput(Value value) {
        outputs.add(value);
        value.parent = this;
        value.isInput = false;
    }

    public String getName() {
        return name;
    }

    public Status getStatus() {
        return status;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public ArrayList<Value> getInputs() {
        return inputs;
    }

    public ArrayList<Value> getOutputs() {
        return outputs;
    }
}
